package cn.seecoder.ai.controller;

import cn.seecoder.ai.utils.HdfsHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * @author fanyanpeng
 * @date 2023/4/22 2:13
 */
@Slf4j
@RestController
@RequestMapping("${apiPrefix}/download")
public class DownloadController {



    @Autowired
    HdfsHelper hdfsHelper;

    @GetMapping("")
    public void downloadFile(@RequestParam String fileUri, HttpServletResponse httpServletResponse){
        hdfsHelper.downloadFileByFileUri(fileUri,httpServletResponse);
    }


}
